//
//  KYVScrollToolBarView.h
//  BeanVideo
//
//  Created by zhangliang on 2017/4/24.
//  Copyright © 2017年 zhangliang. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "KYVBangItem.h"

@interface KYVScrolLToolBarAppearance : NSObject

@property (nonatomic, strong) UIFont *titleFont;
@property (nonatomic, assign) CGFloat titleViewHeight;
@property (nonatomic, assign) CGFloat titleOffset;
@property (nonatomic, assign) CGFloat titleMargin;
@property (nonatomic, assign) CGFloat bottomLineHeight;
@property (nonatomic, assign) CGFloat maxScaleRatio;

/**   颜色选中正常状态   */
@property (nonatomic, strong) UIColor *colorNormal;
@property (nonatomic, strong) UIColor *colorSelected;
@property (nonatomic, strong) UIColor *bottomLineColor;
@property (assign, nonatomic) BOOL isBottomLineAnimation;
@property (nonatomic, assign) BOOL isScrollEnable;
@property (nonatomic, assign) BOOL isShowBottomLine;
@property (nonatomic, assign) BOOL isNeedScale;

@end

@class KYVScrollToolBarView;
@protocol KYVScrollToolBarViewDelegate <NSObject>

- (void)scrollToolBarView:(KYVScrollToolBarView *)toolBarView lastIndex:(NSUInteger)lastIndex selectIndex:(NSUInteger)selectIndex;

@end

@interface KYVScrollToolBarView : UIView

@property (nonatomic, weak) id<KYVScrollToolBarViewDelegate> delegate;
//
@property (nonatomic, strong) NSArray<KYVBangItem *> *items;

@property (nonatomic, assign) NSUInteger selectIndex;

/**   颜色选中正常状态   */
@property (nonatomic, strong) KYVScrolLToolBarAppearance *appearance;

// 点击了item
@property (nonatomic, copy) void(^ClickedScrollBarItem) (NSUInteger lastIndex, NSUInteger selectIndex);

///初始化方法
- (KYVScrollToolBarView *)initWithFrame:(CGRect)frame;


// 这个用于控制器在横向滑动的时候 方式1
- (void)scrollSuperTarget:(UIView *)contentView
            currentOffset:(CGFloat)currentOffsetX;

// 界面再横向切换的时候使用 方式2
- (void)scrollSuperTarget:(id)target startOffset:(CGFloat)startOffset currentOffset:(CGFloat)currentOffset contentWidth:(CGFloat)contentWidth __deprecated_msg("⚠️ 用此方法，必须试着targetScrollView的bounces属性为NO,否则存在bug 滑动过快的时候会出现字体颜色乱变，指示线乱跳");

@end


